/*    */ package com.zimbra.cs.service.mail;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.OperationContext;
/*    */ import com.zimbra.cs.mailbox.SearchFolder;
/*    */ import com.zimbra.cs.service.util.ItemId;
/*    */ import com.zimbra.cs.service.util.ItemIdFormatter;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ModifySearchFolder
/*    */   extends MailDocumentHandler
/*    */ {
/* 40 */   private static final String[] TARGET_FOLDER_PATH = { "search", "id" };
/* 41 */   protected String[] getProxiedIdPath(Element request) { return TARGET_FOLDER_PATH; }
/* 42 */   protected boolean checkMountpointProxy(Element request) { return false; }
/*    */   
/*    */   public Element handle(Element request, Map<String, Object> context) throws ServiceException {
/* 45 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 46 */     Mailbox mbox = getRequestedMailbox(zsc);
/* 47 */     OperationContext octxt = getOperationContext(zsc, context);
/* 48 */     ItemIdFormatter ifmt = new ItemIdFormatter(zsc);
/*    */     
/* 50 */     Element t = request.getElement("search");
/* 51 */     ItemId iid = new ItemId(t.getAttribute("id"), zsc);
/* 52 */     String query = t.getAttribute("query");
/* 53 */     String types = t.getAttribute("types", null);
/* 54 */     String sort = t.getAttribute("sortBy", null);
/*    */     
/* 56 */     mbox.modifySearchFolder(octxt, iid.getId(), query, types, sort);
/* 57 */     SearchFolder search = mbox.getSearchFolderById(octxt, iid.getId());
/*    */     
/* 59 */     Element response = zsc.createElement(MailConstants.MODIFY_SEARCH_FOLDER_RESPONSE);
/* 60 */     ToXML.encodeSearchFolder(response, ifmt, search);
/* 61 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/mail/ModifySearchFolder.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */